package com.triones.api.controller.web;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.api.entity.CryptoExchangeDO;
import com.triones.api.entity.CryptoSysBillDO;
import com.triones.api.entity.CryptoTransferDO;
import com.triones.api.entity.param.GlobalAccountParams;
import com.triones.api.entity.vo.*;
import com.triones.api.service.GlobalAccountService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 全球账户
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/globalAccount")
public class GlobalAccountController extends BaseController {

    private final GlobalAccountService globalAccountService;

//    /**
//     * 入账记录列表（分页）
//     */
//    @SaCheckPermission("system:entryList:list")
//    @GetMapping("/entry/pageList")
//    public TableDataInfo<GlobalAccountEntryVO> entryPageList(GlobalAccountParams globalAccountParams, PageQuery pageQuery) {
//        return globalAccountService.entryPageList(globalAccountParams, pageQuery);
//    }

    /**
     * leptage全球账户列表
     */
    @SaCheckPermission("system:leptage:pageList")
    @GetMapping("/leptage/list")
    public R<List<LeptageGlobalAccountVO>> leptageList(String ccy) {
        return R.ok(globalAccountService.leptageList(ccy));
    }

    /**
     * leptage提现列表（分页）
     */
    @SaCheckPermission("system:leptage:pageList")
    @GetMapping("/leptage/withdrawPageList")
    public TableDataInfo<CryptoSysBillVO> withdrawPageList(CryptoSysBillDO dto, PageQuery pageQuery) {
        return globalAccountService.withdrawPageList(dto,pageQuery);
    }

    /**
     * leptage划转列表（分页）
     */
    @SaCheckPermission("system:leptage:pageList")
    @GetMapping("/leptage/transferPageList")
    public TableDataInfo<CryptoTransferVO> transferPageList(CryptoTransferDO dto, PageQuery pageQuery) {
        return globalAccountService.transferPageList(dto,pageQuery);
    }

    /**
     * leptage换汇列表（分页）
     */
    @SaCheckPermission("system:leptage:pageList")
    @GetMapping("/leptage/exchangePageList")
    public TableDataInfo<CryptoExchangeVO> exchangePageList(CryptoExchangeDO dto, PageQuery pageQuery) {
        return globalAccountService.exchangePageList(dto,pageQuery);
    }
}
